<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>	
	<script src="<%=contextPath %>/js/validator.js"></script>
	<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
	<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="<%=contextPath%>/js/advanceSearch.js"></script>
   <link rel="stylesheet" href="<%=contextPath%>/ext3/resources/css/ext-all.css" type="text/css"   />
    <script src="<%=contextPath%>/ext3/adapter/ext/ext-base.js"></script>
    <script src="<%=contextPath%>/ext3/ext-all.js"></script>
	<link href="<%=contextPath%>/css/search_v3.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath%>/css/common.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
	Ext.onReady(function(){
		var tb = new Ext.Toolbar({
		    renderTo: Ext.get('tbar'),
		    items: ['',
		        {
		            text: '查询',
		             icon:"<%=contextPath%>/" + "images/query.gif",
		             hidden:${(btn_query_display==null)?"true":"false"},
		             handler:cmt
		        },
		        {
		            text: '起草',
		            icon:"<%=contextPath%>/" + "images/add.gif",
		            hidden:${(btn_add_display==null)?"true":"false"},
		            handler:add
		        },
		        {
		            text: '修改',
		            icon:"<%=contextPath%>/" + "images/editlink.gif",
		            hidden:${(btn_add_display==null)?"true":"false"},
		            handler:toDetail
		            
		        },
		        {
		            text: '提交',
		            icon:"<%=contextPath%>/" + "images/fasong.png",
		            hidden:${(btn_add_display==null)?"true":"false"},
		            handler:option
		        },
		        
		        {
		            text: '删除',
		            icon:"<%=contextPath%>/" + "images/guanbi.gif",
		            hidden:${(btn_delete_display==null)?"true":"false"},
		            handler:deleteIt
		        }
		          
		    ]
		});
	});
	</script>
   <script>
   	  
			function add(){
			newPlanFormWin.show();
				//window.location.href = "<%=contextPath%>/jsp/education/itemmanager/mainProjectDeclar.jsp?id=0";
			}		
			// 新建修改进入详细页面
			function toDetail(){
				 if(!isChecked("id")){
						alert("请选择项目！");
						return false;
					}
					 getCheckedId("id"); 
					    //获得id
				   window.location.href = "<%=contextPath%>/jsp/education/itemmanager/mainProjectDeclar.jsp?id="+checkedid;
			}
			// 查看详细页面
			function toInfo(id){
				   window.location.href = "<%=contextPath%>/jsp/education/itemmanager/mainProjectDeclar.jsp?id="+id;
			}
				//人员评价
			function option(){
				if(!isChecked("id")){
					alert("请选择项目！");
					return false;
				}
				 getCheckedId("id");//获取id值
			//	window.open('<%=contextPath%>/projectDeclaration!comitproject.do?id='+checkedid, '人员评价', 'height=500, width=800, top=150, left=200, toolbar=no, menubar=no');
				if(confirm("确定要要将项目提交吗？")) {
				
				document.frmM.action = "<%=contextPath%>/projectDeclaration!updatetest.do?state=1";
				document.frmM.submit();
				}
			}
					 
			// 查询
			function cmt() {
				document.frmM.action = "<%=contextPath%>/projectDeclarationList!getList.do?page=1&c=c";
				document.frmM.submit();
			}

			// 删除
			function deleteIt(){
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/projectDeclaration!delete.do";
					document.frmM.submit();
		    	}
			}
		/*	function print(){
			 	if(!isChecked("id")){
						alert("请选择项目！");
						return false;
				}
					getCheckedId("id"); 
				 window.open('<%=contextPath%>/projectDeclaration!printFind.do?id='+checkedid, '项目申报详细信息', '');
			}	*/
			 var newPlanForm = new Ext.form.FormPanel({
						  frame:true,
						  autoHeight:true,	
						  width:600,
						  labelWidth:80,
						  items:[{
							  xtype:"fieldset",
							  title:"基本信息",
							  autoHeight:true,			//使自适应展开排版
							  items:[{
								  layout:'column',
						          border:false,
						          items:[{
								  	columnWidth:.5,
								  	layout: 'form',
								    border:false,
								    items: [{
								    	 xtype:'datefield',
						                 fieldLabel: '开始日期',
						                 name: 'startdate',
						                 format:'Y-m-d',
						                 anchor:'95%'
					                   
					                },{
					                   
					                    xtype:'textfield',
							            fieldLabel: '变电站',
							            name: 'stationname',
							            anchor:'95%'
					                },{
					                    xtype:'textfield',
							            fieldLabel: '停电范围',
							            name: 'powerrange',
							            anchor:'95%'
					                }]
						          },{
									  	columnWidth:.5,
									  	layout: 'form',
									    border:false,
									    items: [{
									    	xtype:'datefield',
						                    fieldLabel: '结束日期',
						                    format:'Y-m-d',
						                    name: 'enddate',
						                    anchor:'95%'
						                   
						                }, {
						                    
						                    xtype:'textfield',
								            fieldLabel: '电压等级',
								            name: 'voltagelevel',
								            anchor:'95%'
						                },{
						                    xtype:'textfield',
								            fieldLabel: '设备类别',
								            name: 'etype',
								            anchor:'95%'
						                }]
						          }]
							  },{ 
								  columnWidth:1,
								  xtype:'textfield',
						          fieldLabel: '工作项目',
						          name: 'workcontent',
						          anchor:'97.5%'
							  },{ 
								  columnWidth:1,
								  xtype:'textfield',
						          fieldLabel: '备注',
						          name: 'remarks',
						          anchor:'97.5%'
							  }]
								  	
						  },{
								  xtype:"fieldset",
								  id:'gzzz_fs',
								  title:"工作组织",
								  hidden:true,
								  collapsible: true,
								  collapsed: true,
								  autoHeight:true,			//使自适应展开排版
								  items:[{
									  xtype:"fieldset",
									  title:"变电检修班",
									  autoHeight:true,	
									  items:[{
									         layout:'column',
									         border:false, 
									         items: [{
										  			columnWidth:.5, 
										  			layout: 'form',
										  			items: [{
										  					xtype:'textfield',
											  				fieldLabel:"负责人",
											  				name:"bdfzr",
											  				 anchor:'95%'
										  			}]
									         	  },{
									        		columnWidth:.5, 
													layout: 'form',
													items: [{
														    xtype:'textfield',
													  		fieldLabel:"工作班成员",
													  		name:"bdgzzcy",
													  		anchor:'95%'
												 	}]
									             }]
									     }]
									  },{
										  xtype:"fieldset",
										  title:"变压器班",
										  autoHeight:true,	
										  items:[{
										         layout:'column',
										         border:false, 
										         items: [{
											  			columnWidth:.5, 
											  			layout: 'form',
											  			items: [{
											  					xtype:'textfield',
												  				fieldLabel:"负责人",
												  				name:"bdfzr",
												  				 anchor:'95%'
											  			}]
										         	  },{
										        		columnWidth:.5, 
														layout: 'form',
														items: [{
															    xtype:'textfield',
														  		fieldLabel:"工作班成员",
														  		name:"bdgzzcy",
														  		anchor:'95%'
													 	}]
										             }]
										     }]
										  },{
											  xtype:"fieldset",
											  title:"继电保护班",
											  autoHeight:true,	
											  items:[{
											         layout:'column',
											         border:false, 
											         items: [{
												  			columnWidth:.5, 
												  			layout: 'form',
												  			items: [{
												  					xtype:'textfield',
													  				fieldLabel:"负责人",
													  				name:"bdfzr",
													  				 anchor:'95%'
												  			}]
											         	  },{
											        		columnWidth:.5, 
															layout: 'form',
															items: [{
																    xtype:'textfield',
															  		fieldLabel:"工作班成员",
															  		name:"bdgzzcy",
															  		anchor:'95%'
														 	}]
											             }]
											     }]
											  },{
												  xtype:"fieldset",
												  title:"试验班",
												  autoHeight:true,	
												  items:[{
												         layout:'column',
												         border:false, 
												         items: [{
													  			columnWidth:.5, 
													  			layout: 'form',
													  			items: [{
													  					xtype:'textfield',
														  				fieldLabel:"负责人",
														  				name:"bdfzr",
														  				 anchor:'95%'
													  			}]
												         	  },{
												        		columnWidth:.5, 
																layout: 'form',
																items: [{
																	    xtype:'textfield',
																  		fieldLabel:"工作班成员",
																  		name:"bdgzzcy",
																  		anchor:'95%'
															 	}]
												             }]
												     }]
												  }]
								  },{
									  xtype:"fieldset",
									  title:"工作监督",
									  id:'gzjd_fs',
									  hidden:true,
									  collapsible: true,
									  collapsed: true,
									  autoHeight:true,	
									  items:[{
									         layout:'column',
									         border:false, 
									         items: [{
										  			columnWidth:.5, 
										  			layout: 'form',
										  			items: [{
										  					xtype:'textfield',
											  				fieldLabel:"到位人员",
											  				name:"bdfzr",
											  				 anchor:'95%'
										  			}]
									         	  },{
									        		columnWidth:.5, 
													layout: 'form',
													items: [{
														    xtype:'textfield',
													  		fieldLabel:"验收人员",
													  		name:"bdgzzcy",
													  		anchor:'95%'
												 	}]
									             }]
									  }]
								  }],
						tbar:{
							 width: '100%',
							 items:[{
								pressed : true,
								text : '保存',
								icon:contextpath + '/images/save.gif',
							    handler:function(){
						    	 	
						     	}
							},'-',{
								pressed : true,
								text : '提交（至审核班组安排）',
								icon:contextpath + '/images/save.gif',
							    handler:function(){
						    	 	
						     	}
							},'-',{
								pressed : true,
								text : '填写工作组织',
								icon:contextpath + '/images/remark.gif',
							    handler:function(){
								 Ext.getCmp('gzzz_fs').show();
						     	}
							},'-',{
								pressed : true,
								text : '填写工作监督',
								icon:contextpath + '/images/remark.gif',
							    handler:function(){
								 Ext.getCmp('gzjd_fs').show();
						     	}
							},'-',{
								pressed : true,
								text : '关闭',
								icon:contextpath + '/images/delete.gif',
							    handler:function(){
						    	 	
						     	}
							}]
					  }
					});
			    var newPlanFormWin = new Ext.Window({
					  	title   : "生产计划",
			    		width:615,
			    		autoHeight :true,	
			    		closable   : true,
			    		modal      : true,
			    		buttonAlign : 'center',
			    		plain   : true,
			    		items:[newPlanForm]
				  });
	</script>
	
	
  </head>
  
  <body>
 <body>
  <div id ='tbar'></div>
		<form id="frmM" class="ct" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			 <input type="hidden" name="searchBean.displayFlag" value="${searchBean.displayFlag}"/>
			 <input type="hidden" name="searchBean.con6" id="searchBean.con6" value="${searchBean.con6}" >
			<input type="hidden" name="conditionHtml" />
			<table width="100%" id="contab" >
				<tr>
					<th >开始时间：</th >
					<td  align="left" >
					<input type="text"  onclick="WdatePicker({el:$dp.$('searchBean.con1')})" name="searchBean.con1" id="searchBean.con1" value=${searchBean.con1 }>
					</td>
					<th >结束时间：</th >
					<td  align="left" >
					<input type="text"  onclick="WdatePicker({el:$dp.$('searchBean.con2')})"  name="searchBean.con2" id="searchBean.con2" value=${searchBean.con2 }>
					</td>
				</tr>
				<tr>
					<th >班组</th >
					<td  align="left">
					<input type="text" name="searchBean.con3" id="searchBean.con3" value="${searchBean.con3}" >
					</td>
					<th >变电站：</th >
					<td  align="left" >
					 <s:select  id="searchBean.con4"  name="searchBean.con4" list="#{'':'全部','10kV':'10kV
','35kV':'35kV','110kV':'110kV','220kV':'220kV'}" listKey="key" listValue="value" />
					</td>
		</tr>
			</table>
		<hr>
		<table width="100%" id="listtab">
    		<tr>
    			<th width="10%">
	           <input name="chkAll" type="checkbox" id="chkAll"
				onclick="javascript:checkAll(this.form, 'id');" value="checkbox">全选
				</th>
				<th class="ct">开始时间</th>
				<th class="ct" >结束时间</th>
				<th class="ct" >班组</th>
				<th class="ct" >变电站</th>
				<th class="ct" >停电范围</th>
				<th class="ct" >电压等级</th>
				<th class="ct" >工作项目</th>
				
			</tr>
			<c:forEach items="${list}" var="Tab" >
					<tr>
						<td >
							<input type="checkbox" name="id" id = "id" value="${Tab.id}" />
						<br></td>
				  		<td><a href="#" onClick="javascript:toInfo('<c:out value="${Tab.id}"/>')" />1${Tab.projectno}</a></td>
						<td align="left">1${Tab['projectname']}</td>
						<td>${Tab['unit']}</td>
						<td>${Tab['directorName']}</td>
						<td>${Tab['studentsCredits']}</td>
						<td>${Tab['studentsCredits']}</td>
						<td>1${Tab['studentsCredits']}</td>
					</tr>
				</c:forEach>

				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="9" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
		</table>
			<table width="100%" id="tablestyle2">
			<tr>
				<td>
					<hr />
				</td>
			</tr>
			<tr>
				<td>${pageDown}</td>
			</tr>
		</table>
	</form>
  </body>
</html>
